//-----------------------------------------------------------------------
// <copyright file="YeuCauServiceBase.cs" company="Pyramid Consulting">
//     Copyright (c) Pyramid Consulting. All rights reserved.
// </copyright>
//-----------------------------------------------------------------------	

using System;
using System.Collections;
using Pyco;
using Pyco.Diagnostics;
using Pyco.Data;
using APPro.Entities;
using APPro.Data;
    
namespace APPro.Business
{   
	/// <summary>
	/// 
	/// </summary> 
    public class YeuCauServiceBase
    {
        #region YeuCauServiceBase

        public static void CreateYeuCau(YeuCau yeuCau)
        {            
            try
            {
                YeuCauDAO yeuCauDAO = new YeuCauDAO();
                yeuCauDAO.CreateYeuCau(yeuCau);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessCreateYeuCauException, ex);
            }
        }

        public static void UpdateYeuCau(YeuCau yeuCau)
        {            
            try
            {
                YeuCauDAO yeuCauDAO = new YeuCauDAO();
                yeuCauDAO.UpdateYeuCau(yeuCau);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessUpdateYeuCauException, ex);
            }
        }        

        public static void DeleteYeuCau(int maYeuCau)
        {            
            try
            {
                YeuCauDAO yeuCauDAO = new YeuCauDAO();
                yeuCauDAO.DeleteYeuCau(maYeuCau);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessDeleteYeuCauException, ex);
            }
        }
		
        public static YeuCau GetYeuCau(int maYeuCau)
        {            
            try
            {
                YeuCauDAO yeuCauDAO = new YeuCauDAO();
                return yeuCauDAO.GetYeuCau(maYeuCau);                
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessGetYeuCauException, ex);
            }
        }                
		
        public static YeuCauCollection GetYeuCauList(YeuCauColumns orderBy, OrderDirection orderDirection)
        {            
            try
            {
                YeuCauDAO yeuCauDAO = new YeuCauDAO();
                return yeuCauDAO.GetYeuCauList(orderBy, orderDirection);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessGetYeuCauListException, ex);
            }
        }        

        public static YeuCauCollection GetYeuCauList(YeuCauColumns orderBy, OrderDirection orderDirection, int page, int pageSize, out int totalRecords)
        {            
            try
            {
                YeuCauDAO yeuCauDAO = new YeuCauDAO();
                return yeuCauDAO.GetYeuCauList(orderBy, orderDirection, page, pageSize, out totalRecords);
            }
            catch (BusinessException)
            {
                throw;
            }
            catch (Exception ex)
            {
                // log this exception
                Logger.Error(ex);
                // wrap it and rethrow
                throw new BusinessException(SRBase.BusinessGetYeuCauListException, ex);
            }
        }        
		
		
        #endregion
    }
}